#include <stdio.h>
#include <ctype.h>
int main(void)
{
    char ch, fname = ' ';
    printf("Enter a first and last name: ");
    while ((ch = getchar()) != '\n') {
        if (fname == ' ')
            fname = toupper(ch);
        else 
            if (ch == ' ') {
                while ((ch = getchar()) == ' ')
                    /* 空语句 */;
                do {
                    printf("%c", ch);
                    ch = getchar();
                } while (ch != ' ' && ch != '\n');
                break;
            }
    }
    printf(", %c.\n", fname);
    return 0;
}